package com.example;

import android.os.Bundle;
import android.util.Log;

import com.project.baseApp.BaseActivity;
import com.support.volley.NetworkResponse;
import com.support.volley.Request;
import com.support.volley.RequestQueue;
import com.support.volley.Response;
import com.support.volley.Response.Listener;
import com.support.volley.VolleyError;
import com.support.volley.toolbox.HttpHeaderParser;
import com.support.volley.toolbox.StringRequest;
import com.support.volley.toolbox.Volley;

public class VolleyActivity extends BaseActivity implements Listener<String>, com.support.volley.Response.ErrorListener {
	String url = "";

	@Override
	protected void onCreate(Bundle arg0) {
		super.onCreate(arg0);

		RequestQueue rq = Volley.newRequestQueue(getApplicationContext());
		StringRequest sr = new StringRequest(url, this, this);
		rq.add(sr);
		Request<String> r = new Request<String>(url, this) {

			@Override
			protected Response<String> parseNetworkResponse(NetworkResponse response) {
				String result = new String(response.data);
				Log.d("http_result_parseNetworkResponse", result);
				return Response.success(result, HttpHeaderParser.parseCacheHeaders(response));
				
			}

			@Override
			protected void deliverResponse(String response) {
				Log.d("http_result_deliverResponse", new String(response));

			}
		};

	}

	@Override
	public void onResponse(String response) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onErrorResponse(VolleyError error) {
		// TODO Auto-generated method stub

	}
}
